
<#macro textfield param ...>
<div class="item  ${param.css!}">
<#assign nullable = '${param.nullable?default("")}'>
<#if nullable=="false">
<label class="smltxt red" for="${param.name!}">${param.label!}*</label>
		
<#else>
<label for="${param.name!}">${param.label!}</label>
</#if>

<#assign attributes="" />
<#list param?keys as key>
<#assign value=param[key]/>
<#lt><#assign attributes=attributes+key+"=\'"+value+"\' "/><#rt>
</#list>

<#assign exp='<@s.textfield '+'${attributes}'+ ' theme="simple"></@s.textfield>'/>
<#assign exp=exp?interpret/>
<@exp/>
<#nested>
<span class="smltxt red" style="padding-left:10px;">${param.tip?default('')}</span>

</div>
</#macro>

<#macro datepicker param ...>
<script type="text/javascript">
	jQuery(document).ready(function() {
		var date=component.datePicker('${param.id!}');
		});
</script>

<div class="item ${param.css!}">
	<#assign nullable = '${param.nullable?default("")}'>
	<#if nullable=="false">
		<label class="smltxt red" for="${param.name!}">${param.label!}*</label>
	<#else>
		<label for="${param.name!}">${param.label!}</label>
	</#if>
	
	<#assign attributes="" />
	<#list param?keys as key>
	<#assign value=param[key]/>
<#lt><#assign attributes=attributes+key+"=\'"+value+"\' "/><#rt>
	</#list>
	<#assign exp='<@s.textfield '+'${attributes}'+ ' theme="simple"></@s.textfield>'/>
	<#assign exp=exp?interpret/>
	<@exp/>
</div>
</#macro>


<#macro datefield param ...>
<script type="text/javascript" src="scripts/My97DatePicker/WdatePicker.js"></script>
<div class="item  ${param.css!}" style="float:left;width:440px">
	<#assign nullable = '${param.nullable?default("")}'>
	<#if nullable=="false">
		<label class="smltxt red" for="${param.name!}">${param.label!}*</label>
	<#else>
		<label for="${param.name!}">${param.label!}</label>
	</#if>
	
	<#assign attributes="" />
	<#list param?keys as key>
	<#assign value=param[key]/>
<#lt><#assign attributes=attributes+key+"=\'"+value+"\' "/><#rt>
	</#list>
	<#assign exp='<@s.textfield '+'${attributes}'+ ' theme="simple"></@s.textfield>'/>
	<#assign exp=exp?interpret/>
	<@exp/>
</div>
</#macro>



<#macro select param ...>
<div class="item  ${param.css!}">
<label for="${param.name}">${param.label}</label>
	<#if param.source?exists>
      <select name="${param.name}" >
          <#list param.source as type>
           <option value="${('${"type."+param.value}')?eval}">${('${"type."+param.text}')?eval}</option>
          </#list>
      </select>
    </#if>
<span class="smltxt red" style="padding-left:10px;">${param.tip?default('')}</span>
</div>
</#macro>

<#macro popSelect name id param ...>
	
	<#assign parameter=param.parameter!/>
	<#assign attributes="" />
	<#list param?keys as key>
	<#assign value=param[key]/>
	<#lt><#assign attributes=attributes+key+"=\'"+value+"\' "/><#rt>
	</#list>

	<#assign exp='<@component.textfield value_id="'+'${id!}'+'" '+'${attributes}'+ 'onclick="component.dialog.popWindow(this)" name="${param.fieldName!}">'/>
	<#assign exp=exp+'<@s.hidden name="'+'${name!}'+'" id="'+'${id!}'+'"/>'/>
	<#assign exp=exp+'<input type="button" class="btn popClear" value="清除" onclick="component.dialog.clear(this)" />'/>
	<#assign exp=exp+'</@component.textfield>'/>
	<#assign exp=exp?interpret/>
	<@exp/>
</#macro>